package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type Appconfig struct {
	Mysql
	Redis
}
type Mysql struct {
	Host     string
	Port     int
	User     string
	Password string
	DataBase string
}
type Redis struct {
	Host     string
	Port     int
	Password string
}

var Appcfg Appconfig

func Init() {
	viper.SetConfigFile("C:\\Users\\lenovo\\Desktop\\2302a_news\\appconfig\\config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Appcfg)
	log.Println(Appcfg)
}
